The present disclosure relates to graphical image processing and, in particular, selecting parts of an image.
Typically, for each pixel in an image, an image mask indicates whether each pixel is selected. Image masks are sometimes referred to as image mattes, selection masks or alpha channels. A binary mask is an image mask that can be used to indicate one of two mutually exclusive states for each pixel: selected or not selected, foreground or background, etc. An opacity mask, sometimes referred to as a graded opacity mask, is an image mask that indicates the degree to which each pixel is in one of two mutually exclusive states. The opacity mask can be used to indicate, for example, that some pixels are completely foreground or completely background, while other pixels are mostly foreground and slightly background. The degree to which a given pixel is identified by the opacity mask as foreground can be referred to as the pixel's opacity with respect to the opacity mask.
An opacity mask is often used to select areas of an image that depict objects having soft edges (e.g., edges that blend with other depicted objects or the background). Typically such objects include hair, fur, feathers, fire, smoke, and so forth. An opacity mask can be generated from a binary mask by artificially feathering or softening (e.g., blurring) the edges of the binary mask. However, the resultant opacity mask will typically feature uniformly softened edges that do not reflect the features (e.g., sharp edges) depicted in the image.
An opacity mask can also be generated for an image by selecting a range of colors or using a global color model of opacity that depends on the color of all pixels in the image. However, these techniques may yield an opacity mask that does not completely include the desired area.